package com.solution.admin.customer.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.customer.dao.CustomerAccountDao;
import com.solution.admin.customer.entity.CustomerAccountEntity;
import com.solution.admin.customer.service.CustomerAccountService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 客户提现账号service实现层
 * @author lufer
 * @date 2018-05-04 16:53:12
 */
@Service
public class CustomerAccountServiceImpl extends BaseServiceImpl<CustomerAccountEntity> implements CustomerAccountService {

	/**
	 * 客户提现账号接口
	 */
	@Autowired
	private CustomerAccountDao customerAccountDao;

	protected BaseDao<CustomerAccountEntity> getDao() {
		return this.customerAccountDao;
	}

	/**
	 * 保存客户提现账号
	 * @param customerAccountEntity 客户提现账号实体
	 * @return Long 添加成功客户提现账号的ID
	 * @author lufer
	 * @date 2018-05-04 16:53:12
	 */
	public long saveCustomerAccount(CustomerAccountEntity customerAccountEntity) {
		return customerAccountDao.saveCustomerAccount(customerAccountEntity);
	}

	/**
	 * 分页查询客户提现账号
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author lufer
	 * @date 2018-05-04 16:53:12
	 */
	@Override
	public PageBean listCustomerAccountPage(PageParam pageParam, Map<String, Object> paramMap) {
		return customerAccountDao.listCustomerAccountPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return customerAccountEntity 用户对象
	 * @author lufer
	 * @date 2018-05-04 16:53:12
	 */
	public CustomerAccountEntity getCustomerAccountById(Long id) {
		return customerAccountDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param customerAccountEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author lufer
	 * @date 2018-05-04 16:53:12
	 */
	@Override
	public int updateCustomerAccount(CustomerAccountEntity customerAccountEntity) {
		return customerAccountDao.updateCustomerAccount(customerAccountEntity);
	}
	
	
	/**
	 * 根据条件查询客户提现账号
	 * @param param
	 * @return 数据列表
	 * @author lufer
	 * @date 2018-05-04 16:53:12
	 */
	@Override
	public List<CustomerAccountEntity> listCustomerAccount( Map<String, Object> param){
		return  customerAccountDao.listCustomerAccount(param);
	}
	
	/**
	 * 删除客户提现账号
	 * @param 
	 * @return int 返回删除记录条数
	 * @author lufer
	 * @date 2018-05-04 16:53:12
	 */
	public int deleteCustomerAccountById(long id){
		return  customerAccountDao.deleteById(id);
	}
	
}
